package com.li.blog.utils;


import com.li.blog.dao.pojo.SysUser;

/**
 * 私密静态构造
 * 用ThreadLocal存储信息
 */
public class UserThreadLocal {

  private UserThreadLocal(){}

  private static final ThreadLocal<SysUser> LOCAL = new ThreadLocal<>();

  public static void put(SysUser sysUser){
    LOCAL.set(sysUser);
  }
  public static SysUser get(){
    return LOCAL.get();
  }
  public static void remove(){
    LOCAL.remove();
  }
}
